package application;

import bean.Person;
import config.MyConfig;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringApplicationSource {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
        Person bean = context.getBean(Person.class);
        System.out.println(bean);

//        ApplicationContext context = new AnnotationConfigApplicationContext(MyConfig.class);
//        Person bean = context.getBean(Person.class);
//        System.out.println(bean);


//        String[] names = context.getBeanDefinitionNames();
//        for (String name:names){
//            System.out.println(name);
//        }
    }
}
